package com.idopartx.phonelightning.ui.setting

import android.content.Intent
import com.dotools.privacy.AgreementActivity
import com.dotools.privacy.PrivacyPolicyActivity
import com.dotools.privacy.WebFeedBackActivity
import com.dotools.utils.PackageUtils
import com.dotools.utils.PackageUtils.getPackageName
import com.idopartx.phonelightning.R
import com.idopartx.phonelightning.databinding.FragmentSettingBinding
import com.idopartx.phonelightning.ui.base.BaseFragment

class SettingFragment : BaseFragment<FragmentSettingBinding>() {


    override fun initLayoutResId(): Int {
        return R.layout.fragment_setting
    }

    override fun onCreate() {
        binding?.click = ClickProxy()
        binding?.tvAppName?.text = "${getString(R.string.app_name)}\n${
            PackageUtils.getVersionName(
                requireContext(),
                "com.idopartx.phonelightning"
            )
        }"
    }


    inner class ClickProxy {
        fun feedbackAction() {
            startActivity(Intent(activity, WebFeedBackActivity::class.java))
        }

        fun serviceAction() {
            startActivity(Intent(activity, PrivacyPolicyActivity::class.java))
        }

        fun userDealAction() {
            startActivity(Intent(activity, AgreementActivity::class.java))

        }
    }
}